-- GENERATED SPELL FOR [Coilfang Emissary] --


function spell0_18681(pUnit, Event) --@Arcane Explosion,Self--
pUnit:FullCastSpellOnTarget(33860,pUnit)
pUnit:RegisterEvent('Sorts_18681', 1500, 1)
end

function spell1_18681(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_18681', 8269, 1)
end

function spell2_18681(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(20297,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18681', 7000, 1)
end

function spell3_18681(pUnit, Event) --@Water Spout,n/a--
pUnit:FullCastSpellOnTarget(39207,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18681', 557, 1)
end

function Sorts_18681(pUnit, Event)
local choix_sorts_18681 = math.random(0, 3)
if choix_sorts_18681 == 0 then
pUnit:RegisterEvent('spell0_18681', 1, 1)
end
if choix_sorts_18681 == 1 then
pUnit:RegisterEvent('spell1_18681', 1, 1)
end
if choix_sorts_18681 == 2 then
pUnit:RegisterEvent('spell2_18681', 1, 1)
end
if choix_sorts_18681 == 3 then
pUnit:RegisterEvent('spell3_18681', 1, 1)
end
end

function mob18681_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18681', math.random(1500, 3000), 1)
end

function mob18681_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18681_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18681_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18681, 1, 'mob18681_Action')
RegisterUnitEvent(18681, 2, 'mob18681_Leave')
RegisterUnitEvent(18681, 3, 'mob18681_Kill')
RegisterUnitEvent(18681, 4, 'mob18681_Die')
